package start.demo01.enum7_11;

public class Client {
    public static void main(String[] args){
        Gender gender=Gender.MALE;
        System.out.println(gender.name());
        System.out.println(gender.ordinal());
        Gender sex=gender.valueOf("FEMALE");//将字符串转为枚举,字符串必须为枚举中已有的
        System.out.println(sex.ordinal());
        Gender[] genders=Gender.values();
        for(Gender g:genders)
            System.out.println("name:"+g.name());
    }
}
